package cn.lyvust.demo.shili10.yield01;

/**
 * Description:
 * date: 2021-5-18 19:40
 *
 * @author Guo_guo
 * @since JDK 1.8
 */
public class TaskRunner implements Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
        for (int i = 1; i <= 100; i++) {
            if (i%7 == 0) {
                Thread.yield();
                System.out.print("^" + "\t");
            } else {
                System.out.print(i + "\t");
            }
        }
    }
}
